package com.yanqu.road.entity.activity.jiuzhou.guess;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
//玩家跨服竞猜数据 用来后面的结算
@FieldTypeAnnotation(tableName = "t_c_jiu_zhou_user_guess_data",desc = "玩家跨服竞猜数据")
public class CrossJiuZhouUserGuessData extends DataObject {

    @FieldTypeAnnotation(desc = "活动id",select = true,update = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "玩家id",select = true,update = true)
    private long userId;
    @FieldTypeAnnotation(desc = "玩家竞猜数据")
    private Map<Integer,Map<Integer,Long>> guessDataMap;

    public int getActivityId() {
        return activityId;
    }
    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public long getUserId() {
        return userId;
    }
    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public java.util.Map<java.lang.Integer, java.util.Map<java.lang.Integer, java.lang.Long>> getGuessDataMap() {
        return guessDataMap;
    }
    public void setGuessDataMap(ConcurrentHashMap<java.lang.Integer, Map<java.lang.Integer, java.lang.Long>> guessDataMap) {
        if (null == guessDataMap){
            return;
        }
        if (this.guessDataMap == null || !this.guessDataMap.equals(guessDataMap)) {
            this.guessDataMap = guessDataMap;
            setOp(DataStatus.Update);
        }
    }





    public void guess(int roundId,Map<Integer,Long> guessData){
        if (guessDataMap == null){
            guessDataMap = new ConcurrentHashMap<>();
        }
        guessDataMap.put(roundId,guessData);
        setUpdateOption();
    }

    public CrossJiuZhouUserGuessData(int activityId, long userId) {
        this.activityId = activityId;
        this.userId = userId;
        this.guessDataMap = new ConcurrentHashMap<>();
    }

    public CrossJiuZhouUserGuessData() {
    }
}
